<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/base.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/style.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/swiper.min.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/ydui.css" />
    <title>半岛云</title>  
</head>
<body>
    <input type="hidden" id="active" value="sc">
	<div class="wrap">

		<!--主体区域-->
		<div class="container" style="padding-top:0">
	         <!-- banner -->
			  <div class="swiper-container">
			    <div class="swiper-wrapper">
			      <div class="swiper-slide"><img src="${shopInfo.shopLogo!''}"/></div>
			      <!-- <div class="swiper-slide"><img src="img/banner.png"/></div> -->
			    </div>
			  </div>

			 <!-- list -->  
			<div class="ztmc">
				<h2>商品分类</h2>
				<ul class="index_list">
					<li><a href="/${BasePath}/free/${shopInfo.id!''}/productList"><div><img class="display" src="/${BasePath}/static/mobile/img/zws.png"/></div><p>干鲜果</p></a></li>
					<li><a href="/${BasePath}/free/${shopInfo.id!''}/productList"><div><img class="display" src="/${BasePath}/static/mobile/img/jdbm.png"/></div><p>药材</p></a></li>
					<li><a href="/${BasePath}/free/${shopInfo.id!''}/productList"><div><img class="display" src="/${BasePath}/static/mobile/img/yxhh.png"/></div><p>水产</p></a></li>
					<li><a href="/${BasePath}/free/${shopInfo.id!''}/productList"><div><img class="display" src="/${BasePath}/static/mobile/img/zc.png"/></div><p>其他</p></a></li>
				</ul> 
			</div>
  
			
		<!--主题卖场-->	
		<div class="ztmc">
			<h2>最新上架<a id="more"><i class="icons" >&#xe60a;</i></a></h2>
			<ul class="ztmc_list">
			    <#if data?? && (data?size > 0)>
			    <#list data as product>
					<li>
						<a href="/${BasePath}/free/productDetial?id=${product.id!''}"><div class="img"><img src="${product.productCover!''}"/></div></a>
						<div class="prolist_info">
							<h4>${product.productName!''}</h4>
							<p class="grey">￥${product.productPrice!'0'}</p>
							<p class="red">￥${product.productPrice!'0'}</p>
							<a class="add" data-id="${product.id!''}"><i class="icons">&#xe60b;</i></a>
						</div>
					</li>
				</#list>
                </#if> 
		    </ul>
	   </div>
	   
	   
	   <!-- 新闻/模板-->
<!-- 		<ul class="zq">
			<li><a href="news.html"><i class="icons">&#xe666;</i><span>新闻资讯</span></a></li>
			<li><a href="sc.html"><i class="icons">&#xe776;</i><span>素材专区</span></a></li>
		</ul> 
			 -->

		</div>
	
       
	</div>
	<!--导航栏-->
        <#include "/common/foot.html">
</body>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/swiper.min.js"></script>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/ydui.flexible.js"></script>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/ydui.js"></script>
<script type="text/javascript">
    $(function(){
    	var swiper = new Swiper('.swiper-container', {
	        slidesPerView: 1,
		    spaceBetween:0,
		    loop: true,
		    autoplay: 2500
	    }); 
    	$("#more").click(function(){
    		window.location.href="/${BasePath}/free/${shopInfo.id!''}/productList";   
	    })
	    
	    $(".index_search").click(function(){
	    	$(this).find("p").hide();
	    	$(this).find("input").attr("placeholder","请输入搜索内容")
	    })
	    
	    $(".mrtj_list ul").width($(".mrtj_list ul li").size()*$(".mrtj_list ul li:first").outerWidth(true))
	    
	    /*加入购物车*/
	    $(".add").click(function(){
	        $.ajax({
	            type: 'post',
	            url: "/${BasePath}/shops/addCart",
	            data: {"productId":$(this).attr('data-id')},
	            dataType: 'json',
	            error:function (XMLHttpRequest, textStatus, errorThrown) {
	            	var html =XMLHttpRequest.responseText;
	            	if(html.indexOf("登录")!=-1){
	                	/* 调用2： */
	                	YDUI.dialog.alert('您还未登录，前去登录！', function(){
	                		window.location.href="/${BasePath}/user/login"
	                	});
	            	}else{
	            		YDUI.dialog.alert('操作失败，请稍后再试！');
	            	}
	            },
	            success: function(data){
	                if (data.code == "1"){
	                	/* 调用1(带时间)： */
	                	YDUI.dialog.toast(data.msg, 'success', 2000, function () {
	                	    /* 关闭后调用 */
	                	});
	                }else{
	    				$("#nextBtn").attr('disabled',false);
	    				$("#nextBtn").html("登录");
	                	changeImg();
	                	zz1(data.msg);
	                }
	            }
	        });	    	
	    })
	})
</script>
</html>